package com.wealth.scsj.b_app.view.activity.storesettingmodel;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.wealth.scsj.b_app.R;
import com.wealth.scsj.b_app.view.activity.BaseActivity;
import com.wealth.scsj.b_app.adapter.DistributionInformationAdapter;
import com.wealth.scsj.b_app.bean.DistributionInformationBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 门店设置-配送信息页面
 * @author qxp
 */
public class DistributionInformationPageActivity extends BaseActivity {

    private RecyclerView mDistributionInformationRv;
    private TextView mTvTopTittle;
    DistributionInformationAdapter adapter;
    List<DistributionInformationBean>  list =new ArrayList<>();

    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_distribution_information_page);
    }

    @Override
    protected void initView() {

        mDistributionInformationRv =findViewById(R.id.distribution_information_rv);
        mDistributionInformationRv.setLayoutManager(new LinearLayoutManager(
                DistributionInformationPageActivity.this,LinearLayoutManager.VERTICAL,false));

        mTvTopTittle =findViewById(R.id.tv_top_tittle);
    }

    @Override
    protected void initListener() {

    }

    @Override
    protected void initData() {
        mTvTopTittle.setText("配送信息");
        for(int i =0 ;i<4;i++){
            DistributionInformationBean bean =new DistributionInformationBean();
            bean.setConfig_name("配置"+1);
            List<DistributionInformationBean.InformationBean> inforList =new ArrayList<>();
            for(int j =0;j<3;j++){
                DistributionInformationBean.InformationBean inforBean =new DistributionInformationBean.InformationBean();
                inforBean.setInformation_name("第"+i+"个标准"+j);
                inforBean.setInformation_value(i+j+"KM");
                inforList.add(inforBean);
            }
            bean.setInformationBeanList(inforList);
            list.add(bean);
        }

        adapter =new DistributionInformationAdapter(DistributionInformationPageActivity.this,list);

        mDistributionInformationRv.setAdapter(adapter);

    }
}
